ActionController::Routing::Routes.draw do |map|
  # users
  map.connect 'users/annorations/:login', :controller => 'users', :action => 'annorations'
  map.connect 'users/:login', :controller => 'users', :action => 'show'

  map.connect 'annorations/anonymous', :controller => 'annorations', :action => 'anonymous'

  map.resources :users
  map.resources :annorations
  map.resources :pages
  
  # The priority is based upon order of creation: first created -> highest priority.
  
  # Sample of regular route:
  # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # You can have the root of your site routed by hooking up '' 
  # -- just remember to delete public/index.html.
  # map.connect '', :controller => "welcome"

  # Allow downloading Web Service WSDL as a file with an extension
  # instead of a file named 'wsdl'
  map.connect ':controller/service.wsdl', :action => 'wsdl'

  # default pages
  map.connect '/', :controller => 'default'
  map.connect '/help', :controller => 'default', :action => 'help'
  map.connect '/about', :controller => 'default', :action => 'about'
  map.connect '/contact', :controller => 'default', :action => 'contact'
  map.connect '/widget', :controller => 'default', :action => 'widget'
  
  # login
  map.connect 'logged_in', :controller => 'users', :action => 'logged_in'
  map.connect 'not_authorized', :controller => 'users', :action => 'not_authorized'
  map.connect 'forgot_password', :controller => 'users', :action => 'forgot_password'
  map.connect 'reset_password', :controller => 'users', :action => 'reset_password'
  map.connect 'signup', :controller => 'users', :action => 'signup'
  map.connect 'login', :controller => 'users', :action => 'signin'
  map.connect 'signin', :controller => 'users', :action => 'signin'
  map.connect 'signout', :controller => 'users', :action => 'signout'
  map.connect 'logout', :controller => 'users', :action => 'signout'
  map.connect 'change_password', :controller => 'users', :action => 'change_password'
  map.connect 'welcome', :controller => 'users', :action => 'welcome'
  map.connect 'activate', :controller => 'users', :action => 'activate'
  map.connect 'check_email', :controller => 'users', :action => 'check_email'
  map.connect 'api_key', :controller => 'users', :action => 'api_key'
  map.connect 'widget_annotations', :controller => 'pages', :action => 'widget_annotations'
  
  # tags
  map.connect 'tags/*tags', :controller => 'tags', :action => 'pages'
  
  # Install the default route as the lowest priority.
  map.connect ':controller/:action/:id.:format'
  map.connect ':controller/:action/:id'
  
end
